<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>获取系统的负载（load average）</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.sys-getloadavg" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">sys_getloadavg</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.3, PHP 7)</p><p class="refpurpose"><span class="refname">sys_getloadavg</span> &mdash; <span class="dc-title">获取系统的负载（load average）</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.sys-getloadavg-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>sys_getloadavg</strong></span>
    ( <span class="methodparam">void</span>
   ) : <span class="type">array</span></div>

  <p class="para rdfs-comment">
   返回三个系统负载（系统运行队列中的进程数）的样本数据，分别是1分钟、5分钟和15分钟之前。
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.sys-getloadavg-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   返回一个包含1分钟、5分钟和15分钟之前采样数据的<span class="type"><a href="language.types.array.html" class="type array">array</a></span>。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.sys-getloadavg-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4549">
    <p><strong>Example #1 <span class="function"><strong>sys_getloadavg()</strong></span> 的例子</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$load&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">sys_getloadavg</span><span style="color: #007700">();<br />if&nbsp;(</span><span style="color: #0000BB">$load</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]&nbsp;&gt;&nbsp;</span><span style="color: #0000BB">80</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'HTTP/1.1&nbsp;503&nbsp;Too&nbsp;busy,&nbsp;try&nbsp;again&nbsp;later'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;die(</span><span style="color: #DD0000">'Server&nbsp;too&nbsp;busy.&nbsp;Please&nbsp;try&nbsp;again&nbsp;later.'</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.sys-getloadavg-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">此函数未在 Windows 平台下实现。</span></p></blockquote>
 </div>


</div></div></div></body></html>